home *** CD-ROM | disk | FTP | other *** search
- #include <IOKit/IOService.h>
- // this is the power state array
- // two states = on/off
- enum {
- kDTSOffState = 0, //off
- kDTSOnState = 1, //on
- kNumDTSStates = 2 //number of states
- };
- static const IOPMPowerState ourPowerStates[kNumDTSStates] = {
- {kIOPMPowerStateVersion1,0,0,0,0,0,0,0,0,0,0,0},
- {kIOPMPowerStateVersion1,kIOPMDeviceUsable,IOPMPowerOn,IOPMPowerOn,0,0,0,0,0,0,0,0}
- };
-
- class com_DTS_driver_HelloIOKitwithPowerManagement : public IOService
- {
- OSDeclareDefaultStructors(com_DTS_driver_HelloIOKitwithPowerManagement);
- public:
- virtual bool init(OSDictionary *dictionary = 0);
- virtual void free(void);
- virtual IOService *probe(IOService *provider, SInt32 *score);
- virtual bool start(IOService *provider);
- virtual void stop(IOService *provider);
- // override your providers setPowerState method
- virtual IOReturn setPowerState(unsigned long, IOService *);
- };